package org.itboys.member.entity;

import org.itboys.mongodb.entity.BaseLongIdEntity;

import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Index;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.Indexes;
import org.mongodb.morphia.utils.IndexDirection;

/**
 * 会员的 喜好 收藏 之类的
 * @author 
 *
 */
@Entity(value = "MemberCollect", noClassnameStored = true)
@Indexes(value = {
		@Index(name = "memberCollectObj", value = "memberId,type"),
		@Index(name = "memberCollectType", value = "type,beCollectObjId", unique=true)
		})
public class MemberCollect extends BaseLongIdEntity{

	private static final long serialVersionUID = -4945678598341257627L;
	
	private long memberId; //会员ID
	private int type;//被收藏的对象类型 自己定 比如 商品 文章 或者感兴趣的建材分类 等等 
	private long beCollectObjId; //被收藏的对象ID
	@Indexed(value = IndexDirection.DESC)
	private long collectTime; //收藏时间 每次收藏修改该时间
	
	public long getMemberId() {
		return memberId;
	}
	public void setMemberId(long memberId) {
		this.memberId = memberId;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public long getBeCollectObjId() {
		return beCollectObjId;
	}
	public void setBeCollectObjId(long beCollectObjId) {
		this.beCollectObjId = beCollectObjId;
	}
	public long getCollectTime() {
		return collectTime;
	}
	public void setCollectTime(long collectTime) {
		this.collectTime = collectTime;
	}
	
	
}
